//package com.common.excel;
//import java.io.IOException;
//import java.io.OutputStream;
//import java.util.List;
//
//import com.alibaba.excel.ExcelWriter;
//import com.alibaba.excel.metadata.BaseRowModel;
//import com.alibaba.excel.metadata.Sheet;
//import com.alibaba.excel.support.ExcelTypeEnum;
//
///**
// * Created with IntelliJ IDEA
// *
// * @Author yuanhaoyue swithaoy@gmail.com
// * @Description
// * @Date 2018-06-07
// * @Time 16:47
// */
//public class ExcelWriterFactroy extends ExcelWriter {
//    private OutputStream outputStream;
//    private int sheetNo = 1;
//
//    public ExcelWriterFactroy(OutputStream outputStream, ExcelTypeEnum typeEnum) {
//        super(outputStream, typeEnum);
//        this.outputStream = outputStream;
//    }
//
//    public ExcelWriterFactroy write(List<? extends BaseRowModel> list, String sheetName,
//                                    BaseRowModel object) {
//        this.sheetNo++;
//        try {
//            Sheet sheet = new Sheet(sheetNo, 0, object.getClass());
//            sheet.setSheetName(sheetName);
//            this.write(list, sheet);
//        } catch (Exception ex) {
//            ex.printStackTrace();
//            try {
//                outputStream.flush();
//            } catch (IOException e) {
//                e.printStackTrace();
//            }
//        }
//        return this;
//    }
//
//    @Override
//    public void finish() {
//        super.finish();
//        try {
//            outputStream.flush();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//    }
//}